<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<html>
<head>
<title>Login Page</title>
<link href="<c:url value='/static/css/styles.css'/>" type="text/css" rel="stylesheet">
	<script src="<c:url value='/static/js/jquery-1.8.3.js'/>"></script> 
	
<style>
.errorblock {
	color: #ff0000;
	background-color: #ffEEEE;
	border: 3px solid #ff0000;
	padding: 8px;
	margin: 16px;
}
</style>
</head>
<body onload='document.f.j_username.focus();'>
	<h3>Login with Username and Password (Authentication with Database)</h3>
	
<span style="float: right">
    <a href="?lang=en">en</a>     | 
    <a href="?lang=es">es</a>
</span>

	<c:if test="${not empty param.error}">
		<div class="errorblock">
			Your login attempt was not successful, try again.<br /> Caused :
			${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
		</div>
	</c:if>

	<form name='f' action="<c:url value='j_spring_security_check' />"
		method='POST'>

		<table>
			<tr>
				<td><spring:message code="user"/><spring:message code="colon"/></td>
				<td><input type='text' name='j_username' value=''>
				</td>
			</tr>
			<tr>
				<td><spring:message code="password"/><spring:message code="colon"/></td>
				<td><input type='password' name='j_password' />
				</td>
			</tr>
			<tr>
				<td colspan='1'><input name="submit" type="submit" class="button"
					value="<spring:message code="submit"/>" />
				</td>
				
				
				<td colspan='2'><input name="reset" class="button" type="reset" value="<spring:message code="reset"/>" />
				</td>
			</tr>
		</table>

	</form>
</body>
</html>